﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.FeesAndFines.Read;

namespace University.Workshop.Presentation.FeesAndFines
{
    /// <summary>
    /// Interaction logic for ReadFees.xaml
    /// </summary>
    public partial class ReadFees : Page, IReadFeesView
    {
        PresenterReadFees pReadFees;
        public ReadFees(Model.FeesAndFines fees)
        {
            InitializeComponent();
            pReadFees = new PresenterReadFees(this, fees);
            pReadFees.LoadDataToView();
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            App.Current.MainWindow.Title = "Ver Tarifa";
        }

        #region Fields
        public decimal Charge
        {
            set
            {
                chargeLbl.Content = value.ToString();
            }
        }

        public decimal NewConnection
        {
            set
            {
                newConnectionLbl.Content = value.ToString();
            }
        }

        public decimal Reconnection
        {
            set
            {
                reconnectionLbl.Content = value.ToString();
            }
        }

        public decimal BaseRate
        {
            set
            {
                baseRateLbl.Content = value.ToString();
            }
        }

        public decimal NewMember
        {
            set
            {
                newMemberLbl.Content = value.ToString();
            }
        }

        public decimal MonthlyContribution
        {
            set
            {
                monthlyContributionLbl.Content = value.ToString();
            }
        }

        public decimal NonPayment
        {
            set
            {
                nonPaymentLbl.Content = value.ToString();
            }
        }

        public decimal MeterViolation
        {
            set
            {
                meterViolationLbl.Content = value.ToString();
            }
        }

        public DateTime? EffectiveDate
        {
            set
            {
                effectiveDateCld.SelectedDate = value;
                effectiveDateCld.DisplayDate = value.Value;
            }
        }
        #endregion

        #region button actions
        private void cancelBtn_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new SearchFees());
        }
        #endregion

    }
}
